#ifndef HSADC_H_
#define HSADC_H_

#include <tT.h>
#include <env.h>
#include "pid.h"

typedef struct hsadc_t
{
	tt_object_t super;
	
	uint32_t disabled;	// bit 'i' for HSADCi.
	int32_t offset[2];
	volatile int32_t value[2];
	
} hsadc_t;

#define hsadc() {tt_object(), 0,{0,0},{0,0}}

extern hsadc_t hsadc;

env_result_t hsadc_init(hsadc_t *self, void *none);
env_result_t hsadc_calibrate0(hsadc_t *self, void *none);
env_result_t hsadc_calibrate1(hsadc_t *self, void *none);
env_result_t hsadc_start(hsadc_t *self, void *none);
env_result_t hsadc_send(int32_t val);

#endif
